//加载当前区域相关信息
function reloadMapAreaInfo(mapId,x,y) {
	gameMapAreaDetailList(mapId,x,y);
	gameMapAreaNpcList(mapId,x,y);
	gameMapAreaMonsterList(mapId,x,y);
	gameMapAreaPlayerList(mapId,x,y);
}

//加载地图区域配置----------------------------------------------------------------------
var current_game_map_detail_map;
function gameMapAreaDetailList(mapId) {
	$.ajax({
		type:"post",
		url: ajaxUrl + "/api/1.0/nsgs/game/map/area/detail.js",
		data:{
			token : window.localStorage.getItem('token'),
			sid: currentSID,
			gameId: 'BOXY',
			mapId: mapId,
			jobId : getTimeMs()
		},
		dataType:"json",
		success:function(request){
			console.log(request);		
			//数据整理为散列表
			current_game_map_detail_map = new HashTable(); 
			for(var i = 0 ; i < request.data.length ; i++){
				current_game_map_detail_map.put(request.data[i].mapId + request.data[i].xnum + request.data[i].ynum, request.data[i]);
			}
		},
		error:function(error){
			console.log(error);	
		}
	});		
}
//获取区域NPC列表----------------------------------------------------------------------
var current_game_area_npc_map;
function gameMapAreaNpcList(mapId,x,y) {
	$.ajax({
		type:"post",
		url: ajaxUrl + "/api/1.0/nsgs/game/map/area/npc.js",
		data:{
			token : window.localStorage.getItem('token'),
			sid: currentSID,
			gameId: 'BOXY',
			mapId: mapId,
			xNum: x,
			yNum: y,
			jobId : getTimeMs()
		},
		dataType:"json",
		success:function(request){
			console.log(request);		
			//数据整理为散列表
			current_game_area_npc_map = new HashTable(); 
			for(var i = 0 ; i < request.data.length ; i++){
				current_game_area_npc_map.put(request.data[i].id, request.data[i]);
			}
		},
		error:function(error){
			console.log(error);	
		}
	});		
}
//获取区域怪物列表----------------------------------------------------------------------
var current_game_area_monster_map;
function gameMapAreaMonsterList(mapId,x,y) {
	$.ajax({
		type:"post",
		url: ajaxUrl + "/api/1.0/nsgs/game/map/area/monster.js",
		data:{
			token : window.localStorage.getItem('token'),
			sid: currentSID,
			gameId: 'BOXY',
			mapId: mapId,
			xNum: x,
			yNum: y,
			jobId : getTimeMs()
		},
		dataType:"json",
		success:function(request){
			console.log(request);		
			//数据整理为散列表
			current_game_area_monster_map = new HashTable(); 
			for(var i = 0 ; i < request.data.length ; i++){
				current_game_area_monster_map.put(request.data[i].id, request.data[i]);
			}
		},
		error:function(error){
			console.log(error);	
		}
	});		
}

//获取区域用户列表----------------------------------------------------------------------
var current_game_area_player_map;
function gameMapAreaPlayerList(mapId,x,y) {
	$.ajax({
		type:"post",
		url: ajaxUrl + "/api/1.0/nsgs/game/map/area/player.js",
		data:{
			token : window.localStorage.getItem('token'),
			sid: currentSID,
			gameId: 'BOXY',
			mapId: mapId,
			xNum: x,
			yNum: y,
			jobId : getTimeMs()
		},
		dataType:"json",
		success:function(request){
			console.log(request);		
			//数据整理为散列表
			current_game_area_player_map = new HashTable(); 
			for(var i = 0 ; i < request.data.length ; i++){
				current_game_area_player_map.put(request.data[i].id, request.data[i]);
			}
		},
		error:function(error){
			console.log(error);	
		}
	});		
}